//
//  FetchedResultsUITableViewController.h
//  Sudoku
//
//  Created by Richard Hodgkins on 29/09/2012.
//  Copyright (c) 2012 Richard Hodgkins. All rights reserved.
//

#import <UIKit/UIKit.h>

@protocol FetchedResultsDataSourceDelegate <UITableViewDataSource, NSFetchedResultsControllerDelegate>

@required
- (NSFetchedResultsController *) resultsController;

@required
- (UITableViewCell *) tableView:(UITableView *)tableView newCellForRowAtIndexPath:(NSIndexPath *)indexPath;

@required
- (void) tableView:(UITableView *)tableView updateCellForRow:(UITableViewCell *)cell atIndexPath:(NSIndexPath *)indexPath;

@end

@interface FetchedResultsUITableViewController : UITableViewController<UITableViewDataSource, NSFetchedResultsControllerDelegate>

@property (nonatomic, assign) id<FetchedResultsDataSourceDelegate> delegate;

- (NSError *) performFetch;

- (UITableViewRowAnimation)tableViewRowAnimationForChangeType:(NSFetchedResultsChangeType)type;

@end
